home *** CD-ROM | disk | FTP | other *** search
/ Spiceworld The Movie - Interactive CD-ROM / Spiceworld The Movie: Interactive CD-ROM.iso / pc / elements / spicetwo.dir / scripts_41.ls < prev    next >
Encoding:
Text File  |  1997-12-04  |  3.3 KB  |  89 lines

  1. on gingerKiss
  2.   global KISSES, PRINTLIST
  3.   if KISSES = VOID then
  4.     set KISSES to 0
  5.   end if
  6.   set kissTimer to 0
  7.   set targetTimer to the ticks
  8.   set currTargetLocs to EMPTY
  9.   set firstRevealCard to 2
  10.   set noOfCardsAcross to 10
  11.   set startTargetNo to 43
  12.   set endTargetNo to 47
  13.   set currTarget to startTargetNo
  14.   set VCrossHairNo to 60
  15.   set HCrossHairNo to 61
  16.   set kissSpriteNo to 50
  17.   set leftPuzzleH to 29
  18.   set topPuzzleV to 74
  19.   set puzzleWidth to 562
  20.   set puzzleHeight to 292
  21.   set pieceWidth to 56
  22.   set pieceHeight to 72
  23.   set the visible of sprite kissSpriteNo to 0
  24.   set noOfPiecesAcross to puzzleWidth / pieceWidth
  25.   set noOfPiecesDown to puzzleHeight / pieceHeight
  26.   set totalPieces to noOfPiecesAcross * noOfPiecesDown
  27.   set the visible of sprite VCrossHairNo to 1
  28.   set the visible of sprite HCrossHairNo to 1
  29.   repeat with x = startTargetNo to endTargetNo
  30.     set piecesAcross to random(noOfPiecesAcross)
  31.     set piecesDown to random(noOfPiecesDown)
  32.     put piecesAcross && piecesDown into line x of currTargetLocs
  33.     set the locH of sprite x to leftPuzzleH + (piecesAcross * pieceWidth)
  34.     set the locV of sprite x to topPuzzleV + (piecesDown * pieceHeight)
  35.   end repeat
  36.   updateStage()
  37.   repeat while the mouseMember = member "kiss mask"
  38.     if (the ticks - targetTimer) > 20 then
  39.       if currTarget = endTargetNo then
  40.         set currTarget to startTargetNo
  41.       else
  42.         set currTarget to currTarget + 1
  43.       end if
  44.       set targetTimer to the ticks
  45.       set piecesAcross to random(noOfPiecesAcross)
  46.       set piecesDown to random(noOfPiecesDown)
  47.       put piecesAcross && piecesDown into line currTarget of currTargetLocs
  48.       set the locH of sprite currTarget to leftPuzzleH + (piecesAcross * pieceWidth)
  49.       set the locV of sprite currTarget to topPuzzleV + (piecesDown * pieceHeight)
  50.       updateStage()
  51.     end if
  52.     if not (kissTimer = 0) then
  53.       if (the ticks - kissTimer) > 10 then
  54.         set the visible of sprite kissSpriteNo to 0
  55.         set kissTimer to 0
  56.       end if
  57.     end if
  58.     set the locV of sprite VCrossHairNo to the mouseV
  59.     set the locH of sprite HCrossHairNo to the mouseH
  60.     updateStage()
  61.     cursor(2)
  62.     if the mouseDown then
  63.       puppetSound("kiss")
  64.       set the locH of sprite kissSpriteNo to the locH of sprite HCrossHairNo
  65.       set the locV of sprite kissSpriteNo to the locV of sprite VCrossHairNo
  66.       set the visible of sprite kissSpriteNo to 1
  67.       updateStage()
  68.       set testV to the locV of sprite kissSpriteNo
  69.       set testH to the locH of sprite kissSpriteNo
  70.       repeat with spriteNo = startTargetNo to endTargetNo
  71.         if (abs(the locV of sprite spriteNo - testV) < 50) and (abs(the locH of sprite spriteNo - testH) < 50) then
  72.           set spriteToHide to ((value(word 2 of line spriteNo of currTargetLocs) - 1) * noOfCardsAcross) + value(word 1 of line spriteNo of currTargetLocs) + (firstRevealCard - 1)
  73.           if the visible of sprite spriteToHide = 1 then
  74.             set the visible of sprite spriteToHide to 0
  75.             set KISSES to KISSES + 1
  76.             if KISSES = totalPieces then
  77.               put "ginger spice print" & RETURN after PRINTLIST
  78.               congratulations()
  79.               returnToMainGame(the frameLabel)
  80.             end if
  81.           end if
  82.           updateStage()
  83.         end if
  84.         set kissTimer to the ticks
  85.       end repeat
  86.     end if
  87.   end repeat
  88. end
  89.